<template>
  <el-input-number
    :value="value"
    :controls="controls"
    :size="size"
    :controls-position="position"
    :min="min"
    :max="max"
    :step="step"
    @change="handleChange"
  ></el-input-number>
</template>

<script>
export default {
  name: "MInputNumber",
  props: {
    value: {
      type: Number,
    },
    placeholder: {
      type: String,
      default: "请输入",
    },
    size: {
      type: String,
      default: "small",
    },
    position: {
      type: String,
      default: "-",
    },
    min: {
      type: Number,
      default: 0,
    },
    max: {
      type: Number,
      default: 99999999999,
    },
    step: {
      type: Number,
      default: 1,
    },
    controls: {
      type: Boolean,
      default: false,
    },
  },
  methods: {
    handleChange(val) {
      this.$emit("input", val);
    },
  },
};
</script>

<style lang="scss" scoped>
.el-input-number--small {
  width: 100%;
}
</style>

<style>
  .el-input-number.is-without-controls .el-input__inner {
    text-align: left !important;
  }
</style>
